<%--
  Created by IntelliJ IDEA.
  User: 27770
  Date: 2025/9/19
  Time: 14:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>商品页面</title>
</head>
<style>
    tr,th,td{
        width: 100px;
        height: 20px;
        line-height: 10px;
        text-align: center;
    }


</style>
<body>
    <table border="1">
        <tr>
            <th>序号</th>
            <th>商品名</th>
            <th>生产厂家</th>
            <th>类型</th>
            <th>价格</th>
            <th>库存</th>
            <th>操作</th>
        </tr>
        <c:forEach  items="${page.data}" var="goods">
            <tr>
                <td>${goods.goodsId}</td>
                <td>${goods.goodsName}</td>
                <td>${goods.goodsFactory}</td>
                <td>${goods.goodsType}</td>
                <td>${goods.goodsPrice}</td>
                <td>${goods.goodsNum}</td>
                <td><a href="delete.do?goodsId=${goods.goodsId}">删除</a></td>
            </tr>
        </c:forEach>
    </table>
    <div class="pageBar">
        <c:if test="${page.hasPrev}">
            <a href="getGoods.do?pageNum=${page.pageNum-1}">上一页</a>
        </c:if>

        <c:forEach  begin="1" end="${page.totalPages}" var="status">
            <a href="getGoods.do?pageNum=${status}">${status}</a>
        </c:forEach>
        <c:if test="${page.hasNext}">
            <a href="getGoods.do?pageNum=${page.pageNum+1}">下一页</a>
        </c:if>
    </div>
</body>
</html>
